home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume1 / rnd < prev    next >
Encoding:
Internet Message Format  |  1987-07-21  |  26.1 KB

  1. Path: uunet!seismo!rochester!cornell!uw-beaver!tektronix!tekgen!tekred!games-request
  2. From: games-request@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v01i097:  rnd - random stuff generator (create a dungeon)
  5. Message-ID: <1412@tekred.TEK.COM>
  6. Date: 20 Jul 87 21:21:51 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 907
  9. Approved: billr@tekred.TEK.COM
  10.  
  11. Submitted by: SalyerDE <des@druhi.att.com>
  12. Comp.sources.games: Volume 1, Issue 97
  13. Archive-name: rnd
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of shell archive."
  23. # Contents:  README Makefile rnd.6 rnd.c Dungeon Dungeon/CAT_ME
  24. #   Dungeon/Corridor Dungeon/Creature Dungeon/Door Dungeon/Room
  25. #   Dungeon/behind_door Dungeon/corr_cont Dungeon/corr_sect
  26. #   Dungeon/exits Dungeon/jewel Dungeon/monster Dungeon/room_cont
  27. #   Dungeon/trap Dungeon/treasure Dungeon/undead Dungeon/weapon
  28. # Wrapped by billr@tekred on Mon Jul 20 14:18:04 1987
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f README -a "${1}" != "-c" ; then 
  31.   echo shar: Will not over-write existing file \"README\"
  32. else
  33. echo shar: Extracting \"README\" \(1762 characters\)
  34. sed "s/^X//" >README <<'END_OF_README'
  35. XHi all you net-people!
  36. X
  37. X[I know it's been a long time, but ... ]
  38. X
  39. X    When I saw Marcus Ranum's Random stuff generator, I thought
  40. Xit was a novel idea, but limiting.  I wanted a way to nest tables
  41. Xand subtables in the subtables themselves.  So I have done that.
  42. XIt was fairly simple to do, (a tribute to Marcus for easily
  43. Xmodified code) just change the 'dohack()' call in 'dosubtable' to
  44. Xa 'doparse()' call instead (after stripping off the number).
  45. X
  46. X    This greatly extends the possibilities of the system, but
  47. Xmakes it much more likely to blow your stack due to recursion.
  48. XBut if you are careful, it should work.
  49. X
  50. X    I also added a few 'features' - there is a default of 10
  51. Xiterations if you hit C/R, each roll of the dice uses the 'best
  52. Xof three tries, and the stat command has been modified as follows:
  53. X
  54. X    If you put an '*' as the first character of the stat string,
  55. Xthe printout will be in an alternate format, i.e.
  56. X    stat Gold 3 100           would produce=>  Gold: 230
  57. X    stat *Gold_pieces 3 100   would produce=>  160 Gold_pieces
  58. X
  59. X    Also included is a subdirectory Dungeon, which uses these new
  60. Xfeatures to create random sections of dungeon corridors.  It is
  61. Xbased loosely on a Dungeon Generator article in a magazine I saw
  62. Xmany moons ago (I don't remember which).  Look it over and see
  63. Xwhat you can do with it.
  64. X
  65. X    I've lost the E-Mail address of Marcus, so I hope he sees
  66. Xthis and approves of the changes I've made.  I also hope everyone
  67. Xelse can use this to further your Dungeon endeavors.
  68. X
  69. X    Real Life?:    Dale Salyer (Programmer of the Third Level)
  70. X    Fantasy:    Dark Star (Thief of the Fifth Level)
  71. X            Coyote (Half-Coyote - Ranger of the Sixth Level)
  72. X
  73. X    E-Mail Address:    ...!ihnp4!druhi!des
  74. X    U.S. Mail:    AT&T Info. Systems Laboratories
  75. X            Denver, CO 80229
  76. END_OF_README
  77. if test 1762 -ne `wc -c <README`; then
  78.     echo shar: \"README\" unpacked with wrong size!
  79. fi
  80. # end of overwriting check
  81. fi
  82. if test -f Makefile -a "${1}" != "-c" ; then 
  83.   echo shar: Will not over-write existing file \"Makefile\"
  84. else
  85. echo shar: Extracting \"Makefile\" \(95 characters\)
  86. sed "s/^X//" >Makefile <<'END_OF_Makefile'
  87. X# Makefile for rnd - random stuff generator
  88. XCFLAGS = -O
  89. X
  90. Xrnd:    rnd.c
  91. X    cc $(CFLAGS) -o rnd rnd.c
  92. END_OF_Makefile
  93. if test 95 -ne `wc -c <Makefile`; then
  94.     echo shar: \"Makefile\" unpacked with wrong size!
  95. fi
  96. # end of overwriting check
  97. fi
  98. if test -f rnd.6 -a "${1}" != "-c" ; then 
  99.   echo shar: Will not over-write existing file \"rnd.6\"
  100. else
  101. echo shar: Extracting \"rnd.6\" \(6425 characters\)
  102. sed "s/^X//" >rnd.6 <<'END_OF_rnd.6'
  103. X.TH rnd 6  12/4/86
  104. X.SH NAME
  105. Xrnd \- Random stuff generator
  106. X.SH SYNOPSIS
  107. X.B rnd
  108. Xfile1 file2, etc...
  109. X.SH DESCRIPTION
  110. X.I rnd 
  111. Xreads a file and writes generated data to the standard output.
  112. XIf more than one file is specified, the files are used as descriptions
  113. Xin sequence and merged output is written to the standard output.
  114. XTwo types of files are recognized: \fBtable\fP files, and \fBsubtable\fP files.
  115. XEach file specified on the command line must be a \fBtable\fP file.
  116. X
  117. XA table file can contain several types of information:
  118. X.TP 8
  119. X\(bu \fBText and Text-formats:\fP
  120. XThese are simply text that will be
  121. Xincluded in the output. There are, however, a few simple rules.
  122. XAny text string ending in a ':' (no space afterwards) will NOT
  123. Xhave a newline appended after it. This is to allow a user to
  124. Xhave the output from a subtable placed after a text string.
  125. XOther text that does not have a ':' as the last character before
  126. Xa newline is printed as is.
  127. X.TP
  128. X\(bu \fBTabs and Formfeeds:\fP
  129. XTo insert tabs and formfeeds, a \fB\\t\fP (tab)
  130. Xor a \fB\\l\fP (formfeed ^L) is placed as the ONLY thing on that line. 
  131. XThere must be no other blank spaces, etc. This is inelegant, but
  132. Xallows the program to run reasonably fast. If a tab is coded, the
  133. Xprogram does NOT automatically generate a newline after it. This
  134. Xis to allow a user to separate stats with tabs reasonably easily.
  135. X.TP
  136. X\(bu \fBStat commands:\fP
  137. XA stat command goes at the beginning of an 
  138. Xotherwise empty line, in the format:
  139. X.nf
  140. X
  141. X     \fBstat\fP <string> <# of dice> <type of dice>
  142. X.fi
  143. X
  144. X\fIrnd\fP will then roll the appropriate number of N-sided dice, and
  145. Xprint the stat on the standard output.
  146. XThe <string> must not have any spaces in it.
  147. X
  148. XNormal output format is:
  149. X
  150. X.nf
  151. X     \fB<string>: <number>\fP
  152. X.fi
  153. X
  154. Xhowever if you make the first character of the <string>
  155. Xa '*' the format will be:
  156. X
  157. X.nf
  158. X     \fB<number> <string>\fP
  159. X.fi
  160. X
  161. Xwithout the '*'.
  162. XThis is useful to produce messages like \fB300 gold_pieces\fP or
  163. X\fB12 large_diamonds\fP.
  164. X.TP
  165. X\(bu Subtable commands: a subtable command goes at the beginning of
  166. Xan otherwise empty line, in the format
  167. X.nf
  168. X
  169. X     \fBsubtable\fP <filename> <# of dice> <type of dice>
  170. X
  171. X.fi
  172. X\fIrnd\fP will then roll the appropriate number of N-sided dice, and
  173. Xopen the subtable file. A subtable file is constructed as follows:
  174. X.nf
  175. X
  176. X     <#upper limit> <command>
  177. X     <#upper limit> <command>
  178. X     ... etc.
  179. X.fi
  180. XWhere <command> can be text, a stat command, a table command,
  181. Xor another subtable command.
  182. X
  183. XSubtable files may not contain any extraneous text (unlike table files)
  184. Xand all the entries must be in order, with the highest numerical entry as the
  185. Xlast line in the file, and the lowest numerical entry as the first.
  186. XEach line must contain a number value and a command, or the results
  187. Xmay be unusual. 
  188. X.TP
  189. X\(bu \fBTable commands:\fP
  190. Xa table can contain a list of tables as well as
  191. Xstats, format commands, text, and subtables. Each table is randomized
  192. Xrecursively, until your stack overflows, or it returns, whichever comes
  193. Xfirst. Stacking tables deeply is usually not necessary, since several
  194. Xtables can be called on the command line, and that is much safer.
  195. XWhen a table command is invoked, it must be followed by two numbers
  196. Xso that the semi-braindead parser recognizes it as a command.
  197. X
  198. X.nf
  199. X     \fBtable\fP <filename> <bogus #><bogus #>
  200. X.fi
  201. X
  202. XEach table can contain its own list of subtables and stats, as well as text
  203. Xand format commands. This is lots of fun, since it allows the discerning
  204. XDM to make a variety of layered tables and gives excellent control
  205. Xover how much is generated. For example if you determine that an encounter
  206. Xconsists of monsters, booty, and terrain, you could have a table that
  207. Xinvoked the monster table, then the terrain one, then the booty. In 
  208. Xthis way, you would still have a perfectly usable set of tables for
  209. Xany time you wanted just a monster, or just terrain. The possibilities
  210. Xas far as maintaining standard libraries are considerable, obviously.
  211. XThe primary limitation is your machine's stack and disk space.
  212. X.bp
  213. X.SH EXAMPLES
  214. X
  215. X$ \fBrnd Pirates\fR
  216. X
  217. X.I rnd 
  218. Xwill read the table named
  219. X.B Pirates
  220. Xand executes all the stats, subtables, and tables contained therein.
  221. X
  222. X\fB(The contents of file "Pirates".)\fR
  223. X.nf
  224. X
  225. X--------------------------------------
  226. XA sample pirate -----
  227. Xstat strength 3 6
  228. X\\t
  229. Xstat brains 3 6
  230. X
  231. Xpossesions:
  232. Xsubtable possesions 1 100
  233. X
  234. Xtable Anothertable 0 0
  235. X
  236. X---------------------------------------
  237. X\\l
  238. X
  239. X.fi
  240. X.ad
  241. XThis would generate a pirate with 3d6 strength and brains, and
  242. Xwould make a 1d100 roll on the possessions table. 
  243. XThe table "Anothertable" is then opened and treated as a new list of
  244. Xcommands. Note that there are 2 numbers provided with the table command.
  245. XThis is MANDATORY, and due only to lazy programming. Live with it.
  246. XAppropriate tabs and
  247. Xa formfeed are generated. 
  248. X
  249. X\fB(contents of file "possesions")\fP
  250. X
  251. X.nf
  252. X10 Cutlass
  253. X20 Fists
  254. X30 subtable beverage 1 100
  255. X40 Belaying Pin
  256. X90 Just his clothes
  257. X100 table armor 0 0
  258. X
  259. X.fi
  260. XIn this example, when the subtable was called, a 1d100 was rolled (be
  261. Xsure to specify that right!) 0-10 yields a Cutlass, 11-20 Fists, etc.
  262. X20-30 will roll on the subtable 'beverage' for a suitable liquid refreshment,
  263. XAnd 91-100 will recurse into the table 'armor' and print out what types
  264. Xof armor the pirate has.
  265. X.SH CAVEATS
  266. X.TP 2
  267. X\(bu
  268. XThis program is machine dependent to the degree that your machine likes
  269. Xrecursion.
  270. X.TP
  271. X\(bu
  272. XThis program has run on Gould Powernode 9080, Sun workstations, and
  273. Xmy IBM compatible clone (lattice 3.0). On the PCs, usually some provision
  274. Xwill have to be made to increase the stack size. On lattice this is
  275. Xdone by declaring a global "int _stack = 6000;" or about 6 kilobytes.
  276. XYou decide. No guarantees are made for other compilers/machines, but
  277. Xanything that is not braindead can handle it. 
  278. X.TP
  279. X\(bu
  280. XCapturing the output: This program is designed for systems with I/O
  281. Xredirection. If you don't have it, I suggest you frob the code slightly
  282. Xby changing all printfs to fprintf, etc. For you with I/O redirection,
  283. Xthe initial text, etc, is returned on the standard error, so it will
  284. Xnot kluge up your characters as they are generated. Pipe the output
  285. Xthrough your favorite formatter, editor, printer, or null device.
  286. X.SH AUTHOR
  287. X.nf
  288. X      Marcus J Ranum, Gould Inc.
  289. X      All rights reserved.
  290. X.fi
  291. X
  292. XDon't use this to make money, or sell. Otherwise it may be freely copied,
  293. Xdeleted, and hacked.
  294. XGive me credit for the idea, if not the code.
  295. END_OF_rnd.6
  296. if test 6425 -ne `wc -c <rnd.6`; then
  297.     echo shar: \"rnd.6\" unpacked with wrong size!
  298. fi
  299. # end of overwriting check
  300. fi
  301. if test -f rnd.c -a "${1}" != "-c" ; then 
  302.   echo shar: Will not over-write existing file \"rnd.c\"
  303. else
  304. echo shar: Extracting \"rnd.c\" \(4930 characters\)
  305. sed "s/^X//" >rnd.c <<'END_OF_rnd.c'
  306. X#include "stdio.h"
  307. X
  308. X/* rnd.c :
  309. X    written by Marcus J Ranum.
  310. X    All rights reserved. You may freely copy, modify, distribute,
  311. X    and delete this program, but any use that will cause you to 
  312. X    gain money is prohibited unless we work out a deal, or you
  313. X    ask me nicely. Any nifty ideas/modifications, please let me
  314. X    know.
  315. X        -mjr
  316. X
  317. X    New Features added by:  Dale Salyer
  318. X           E-Mail Address:    ihnp4!druhi!des
  319. X
  320. X    CHG1) Default of # of iterations.
  321. X    CHG2) Rolling of dice takes best of 3 tries.
  322. X    CHG3) Nesting of subtables.
  323. X    CHG4) Alternate format of stat command.
  324. X
  325. X*/
  326. X
  327. Xmain(argc,argv)
  328. Xint argc;
  329. Xchar *argv[];
  330. X{
  331. X    int a;
  332. X    char seed[100];
  333. X    char word[200];
  334. X    int    iterations;
  335. X
  336. X    /* If you can't do this, change back to old way */
  337. X    long t;
  338. X    time(&t);
  339. X    srand(getpid() + (int)((t>>16) + t));
  340. X
  341. X    /* CHG1) Default is 10 iterations if C/R pressed */
  342. X
  343. X    fprintf(stderr,"How many runs do you want[10]?");
  344. X    iterations=atoi(gets(word));
  345. X    if( iterations == 0 ) iterations = 10;
  346. X
  347. X    while(iterations--) {
  348. X        for(a=1 ; a < argc; a++) {
  349. X            dotable(argv[a]);
  350. X        }
  351. X    }
  352. X}
  353. X
  354. X/* roll a <sides> sided die <num> times [best of three tries] */
  355. X
  356. Xroll(num,sides)
  357. Xint num;
  358. Xint sides;
  359. X{
  360. X    int a=0, m=0;
  361. X    int i, j;
  362. X    for(i=1,j=num;i<=3;i++) {
  363. X        while (j-- >0)
  364. X        a += rnd(sides);
  365. X    /* CHG2) Rolling of dice takes best of 3 tries. */
  366. X        if(a > m) m = a;
  367. X    }
  368. X    return(m);
  369. X}
  370. X
  371. X/* roll a <die> sided die once */
  372. X
  373. Xrnd(die)
  374. Xregister die;
  375. X{
  376. X    return(((rand()>>3) % die)+1);
  377. X}
  378. X
  379. X/* reads a table. calls doparse for every line in the table.
  380. X    note, if doparse hits another table name, this will
  381. X    be recursively called. max recursions seems to be
  382. X    around 10....
  383. X*/
  384. X
  385. Xdotable(table)
  386. Xchar table[];
  387. X{
  388. X    FILE *file;
  389. X    char junk[BUFSIZ];
  390. X
  391. X    if((file = fopen(table,"r")) ==NULL) {
  392. X        fprintf(stderr,"can't open %s\n",table);
  393. X        exit(1);
  394. X    }
  395. X
  396. X    while((fgets(junk,BUFSIZ-3,file)) !=NULL){
  397. X        doparse(junk);
  398. X    }
  399. X    if(fclose(file) == EOF) {
  400. X        fprintf(stderr,"unusual file-close error!\n");
  401. X        exit(1);
  402. X    }
  403. X}
  404. X
  405. X/* reads a subtable, and looks for a numbered entry that matches the
  406. X    given selection criterion. <stat> is the table name, <num> is
  407. X    the number of dice, and <die> is the number of sides on the
  408. X    die. the subtables must be in the form of 
  409. X<#> text entry (text string terminated with newline)
  410. X<#> table entry ...
  411. X<#> subtable entry ...
  412. X<#> stat entry ...
  413. X*/
  414. X
  415. Xdosubtable(stat,num,die)
  416. Xchar stat[];
  417. Xint    num;
  418. Xint    die;
  419. X{
  420. X
  421. X    FILE *tbl;
  422. X
  423. X    char junk[BUFSIZ];
  424. X    char word[100];
  425. X    int old;
  426. X    int new;
  427. X    int pick;
  428. X    int a;
  429. X
  430. X    old=0;
  431. X    if((tbl=fopen(stat,"r")) == NULL){
  432. X        fprintf(stderr,"can't open subtable %s\n",stat);
  433. X    } else {
  434. X        pick = roll(num,die);
  435. X
  436. X        while((fgets(junk,BUFSIZ-3,tbl)) != NULL){
  437. X            if(sscanf(junk,"%d",&new)) {
  438. X                if( pick > old &&  pick <= new) {
  439. X                    if (sscanf(junk,"%s",word)==0) {
  440. X                        fprintf(stderr, "invalid format\n");
  441. X                        exit(1);
  442. X                    }
  443. X                    junk[strlen(junk)-1] = ' ';
  444. X
  445. X                /* CHG3) Nesting of subtables.
  446. X                 *       Skip over number, then call
  447. X                 *       doparse() to re-parse the rest.
  448. X                 */
  449. X                    for(a=0;junk[a] != ' ';a++);
  450. X                    a++;      /* skip over leading space */
  451. X                    doparse(&junk[a]);
  452. X                    break;
  453. X                }
  454. X                old = new;
  455. X            }
  456. X        }
  457. X    }
  458. X    if(fclose(tbl)== EOF) {
  459. X        fprintf(stderr,"unusual file-close error\n");
  460. X        exit(1);
  461. X    }
  462. X}
  463. X
  464. X/* prints a stat <stat> is statname, <num> is number of dice, and 
  465. X    <die> is how many sides the die has. */
  466. X
  467. Xdostat(stat,num,die)
  468. Xchar stat[];
  469. Xint    num;
  470. Xint    die;
  471. X{
  472. X    /* CHG4) Alternate format of stat command. */
  473. X
  474. X    if( stat[0] == '*' ) {
  475. X        printf("%d %s", roll(num,die), &stat[1]);
  476. X    } else {
  477. X        printf("%s:  %d",stat,roll(num,die));
  478. X    }
  479. X}
  480. X
  481. X/* doparse looks for the magic words "table" "subtable" "\t" or "\l"
  482. X    and does the appropriate thing if it encounters them. if it
  483. X    does not, it dumps it as text */
  484. X
  485. Xdoparse(junk)
  486. Xchar junk[];
  487. X{
  488. X    char stat[200];
  489. X    char word[200];
  490. X    int die;
  491. X    int num;
  492. X
  493. X    if( junk[0] == '\\') {
  494. X        switch(junk[1]) {
  495. X        case 'l':
  496. X            putchar(12);
  497. X            break;
  498. X        case 't':
  499. X            printf("\t");
  500. X            break;
  501. X        }
  502. X    } else {
  503. X        if((sscanf(junk,"%s %s %d %d",
  504. X            word,stat,&num,&die))!= 4) {
  505. X            dotext(junk);
  506. X        } else {
  507. X            if(!strcmp(word,"subtable"))
  508. X                dosubtable(stat,num,die);
  509. X            else if(!strcmp(word,"stat"))
  510. X                dostat(stat,num,die);
  511. X            else if(!strcmp(word,"table"))
  512. X                dotable(stat);
  513. X            else
  514. X                dotext(junk);
  515. X        }
  516. X    }
  517. X}
  518. X
  519. X/* dohack takes a string and dumps all of it except the FIRST word.
  520. X    this is basically useful for printing subtable entries.
  521. X    while there are more elegant ways of doing this in C,
  522. X    my Lattice compiler dies when I try it. */
  523. X
  524. Xdohack(string)
  525. Xchar string[BUFSIZ];
  526. X{
  527. X    int a = 0;
  528. X    int b = 0;
  529. X
  530. X    while(b == 0)
  531. X        if(string[a++] == ' ')
  532. X            b++;
  533. X    for(b = a; b < strlen(string); b++)
  534. X        putchar(string[b]);
  535. X}
  536. X
  537. X/* dotext basically dumps a text string.
  538. X    if the 2nd to last char (newline is last) is a ":" 
  539. X    it does NOT put a newline on. this is to allow you to 
  540. X    have items from subtables appear after a :    */
  541. X
  542. Xdotext(string)
  543. Xchar string[BUFSIZ];
  544. X{
  545. X    int c;
  546. X    
  547. X    c = (strlen(string)-2);
  548. X    if (string[c] == ':')
  549. X        string[++c] = ' ';
  550. X    printf("%s",string);
  551. X}
  552. END_OF_rnd.c
  553. if test 4930 -ne `wc -c <rnd.c`; then
  554.     echo shar: \"rnd.c\" unpacked with wrong size!
  555. fi
  556. # end of overwriting check
  557. fi
  558. if test ! -d Dungeon ; then
  559.     echo shar: Creating directory \"Dungeon\"
  560.     mkdir Dungeon
  561. fi
  562. if test -f Dungeon/CAT_ME -a "${1}" != "-c" ; then 
  563.   echo shar: Will not over-write existing file \"Dungeon/CAT_ME\"
  564. else
  565. echo shar: Extracting \"Dungeon/CAT_ME\" \(1552 characters\)
  566. sed "s/^X//" >Dungeon/CAT_ME <<'END_OF_Dungeon/CAT_ME'
  567. X    In this subdirectory is a sample dungeon creator. The basic
  568. Xidea is that a dungeon is made up of Corridors, Doors, Rooms, and
  569. XCreatures that inhabit them.  A corridor can have creatures, doors,
  570. Xand traps, whereas doors can have corridors or closets or rooms
  571. Xbehind them.  A room can have some exits, a trap, and possibly a 
  572. Xmonster or treasure.  Creatures have attributes, possessions and
  573. Xweapons.  Creatures sometimes come up with weird combinations of
  574. Xweapons, such as a floating eye using a long sword, if this occurs,
  575. Xconsider it part of the treasure instead.  
  576. X
  577. X    Note that I have adopted a convention that table files start 
  578. Xwith a capital letter, and subtable files are lower-case.  This helps
  579. Xto remember which can be used as input files.  
  580. X
  581. XThe tables (input files):
  582. X
  583. X    Corridor - The main table, this will create the next section of
  584. X        a dungeon corridor.
  585. X
  586. X    Creature - If you need another monster, use this table.
  587. X
  588. X    Door     - Use this to describe the doors in a room, to expand
  589. X        the dungeon that way.
  590. X
  591. X    Room     - Use this to describe an extra room thrown in for good
  592. X            measure.
  593. X
  594. X    Try it - You'll like it.  If you make any enhancements to this,
  595. Xplease let me know.  I hope you enjoy this and take it as an Aid -
  596. Xnot the end-all of dungeon creation.  Enjoy!
  597. X
  598. X    Real Life?:    Dale Salyer (Programmer of the Third Level)
  599. X    Fantasy:    Dark Star (Thief of the Fifth Level)
  600. X            Coyote (Half-Coyote - Ranger of the Sixth Level)
  601. X
  602. X    E-Mail Address:    ...!ihnp4!druhi!des
  603. X    U.S. Mail:    AT&T Info. Systems Laboratories
  604. X            Denver, CO 80229
  605. X
  606. END_OF_Dungeon/CAT_ME
  607. if test 1552 -ne `wc -c <Dungeon/CAT_ME`; then
  608.     echo shar: \"Dungeon/CAT_ME\" unpacked with wrong size!
  609. fi
  610. # end of overwriting check
  611. fi
  612. if test -f Dungeon/Corridor -a "${1}" != "-c" ; then 
  613.   echo shar: Will not over-write existing file \"Dungeon/Corridor\"
  614. else
  615. echo shar: Extracting \"Dungeon/Corridor\" \(81 characters\)
  616. sed "s/^X//" >Dungeon/Corridor <<'END_OF_Dungeon/Corridor'
  617. X+-------------------------+
  618. X
  619. Xsubtable corr_sect 1 100
  620. X
  621. Xsubtable corr_cont 1 100
  622. X
  623. END_OF_Dungeon/Corridor
  624. if test 81 -ne `wc -c <Dungeon/Corridor`; then
  625.     echo shar: \"Dungeon/Corridor\" unpacked with wrong size!
  626. fi
  627. # end of overwriting check
  628. fi
  629. if test -f Dungeon/Creature -a "${1}" != "-c" ; then 
  630.   echo shar: Will not over-write existing file \"Dungeon/Creature\"
  631. else
  632. echo shar: Extracting \"Dungeon/Creature\" \(241 characters\)
  633. sed "s/^X//" >Dungeon/Creature <<'END_OF_Dungeon/Creature'
  634. X
  635. XA Monster ...
  636. X\t
  637. Xsubtable monster 1 100
  638. X
  639. X\t
  640. XAttributes:
  641. X\t
  642. Xstat Strength 2 20
  643. X\t
  644. Xstat Intelligence 3 6
  645. X
  646. X\t
  647. X\t
  648. X\t
  649. Xstat Dexterity 3 6
  650. X\t
  651. Xstat Constitution 3 12
  652. X
  653. X\t
  654. XPossessions:
  655. X\t
  656. Xsubtable treasure 1 100
  657. X
  658. X\t
  659. XWeapon:
  660. X\t
  661. Xsubtable weapon 1 100
  662. X
  663. END_OF_Dungeon/Creature
  664. if test 241 -ne `wc -c <Dungeon/Creature`; then
  665.     echo shar: \"Dungeon/Creature\" unpacked with wrong size!
  666. fi
  667. # end of overwriting check
  668. fi
  669. if test -f Dungeon/Door -a "${1}" != "-c" ; then 
  670.   echo shar: Will not over-write existing file \"Dungeon/Door\"
  671. else
  672. echo shar: Extracting \"Dungeon/Door\" \(98 characters\)
  673. sed "s/^X//" >Dungeon/Door <<'END_OF_Dungeon/Door'
  674. XA door ...
  675. X\t
  676. XIt is:
  677. Xsubtable trap 1 100
  678. X
  679. X\t
  680. XBehind it will be found:
  681. Xsubtable behind_door 1 100
  682. X
  683. END_OF_Dungeon/Door
  684. if test 98 -ne `wc -c <Dungeon/Door`; then
  685.     echo shar: \"Dungeon/Door\" unpacked with wrong size!
  686. fi
  687. # end of overwriting check
  688. fi
  689. if test -f Dungeon/Room -a "${1}" != "-c" ; then 
  690.   echo shar: Will not over-write existing file \"Dungeon/Room\"
  691. else
  692. echo shar: Extracting \"Dungeon/Room\" \(187 characters\)
  693. sed "s/^X//" >Dungeon/Room <<'END_OF_Dungeon/Room'
  694. X
  695. XA Room ...
  696. X\t
  697. XIt's size is:
  698. X\t
  699. Xstat width 2 10
  700. X\t
  701. Xstat length 3 10
  702. X
  703. X\t
  704. XThe room is:
  705. Xsubtable trap 1 100
  706. X
  707. X\t
  708. XThe room has:
  709. Xsubtable exits 1 100
  710. X
  711. X\t
  712. XIt contains:
  713. Xsubtable room_cont 1 100
  714. X
  715. END_OF_Dungeon/Room
  716. if test 187 -ne `wc -c <Dungeon/Room`; then
  717.     echo shar: \"Dungeon/Room\" unpacked with wrong size!
  718. fi
  719. # end of overwriting check
  720. fi
  721. if test -f Dungeon/behind_door -a "${1}" != "-c" ; then 
  722.   echo shar: Will not over-write existing file \"Dungeon/behind_door\"
  723. else
  724. echo shar: Extracting \"Dungeon/behind_door\" \(66 characters\)
  725. sed "s/^X//" >Dungeon/behind_door <<'END_OF_Dungeon/behind_door'
  726. X65 table Room 0 0
  727. X75 an empty closet
  728. X100 a corridor like the rest
  729. END_OF_Dungeon/behind_door
  730. if test 66 -ne `wc -c <Dungeon/behind_door`; then
  731.     echo shar: \"Dungeon/behind_door\" unpacked with wrong size!
  732. fi
  733. # end of overwriting check
  734. fi
  735. if test -f Dungeon/corr_cont -a "${1}" != "-c" ; then 
  736.   echo shar: Will not over-write existing file \"Dungeon/corr_cont\"
  737. else
  738. echo shar: Extracting \"Dungeon/corr_cont\" \(153 characters\)
  739. sed "s/^X//" >Dungeon/corr_cont <<'END_OF_Dungeon/corr_cont'
  740. X5 There is nothing here.
  741. X55 table Creature 0 0
  742. X60 There is a set of stairs here.
  743. X63 subtable trap 1 100
  744. X69 There is a trap door here.
  745. X100 table Door 0 0
  746. END_OF_Dungeon/corr_cont
  747. if test 153 -ne `wc -c <Dungeon/corr_cont`; then
  748.     echo shar: \"Dungeon/corr_cont\" unpacked with wrong size!
  749. fi
  750. # end of overwriting check
  751. fi
  752. if test -f Dungeon/corr_sect -a "${1}" != "-c" ; then 
  753.   echo shar: Will not over-write existing file \"Dungeon/corr_sect\"
  754. else
  755. echo shar: Extracting \"Dungeon/corr_sect\" \(313 characters\)
  756. sed "s/^X//" >Dungeon/corr_sect <<'END_OF_Dungeon/corr_sect'
  757. X25 Corridor continues straight
  758. X29 Corridor continues straight, narrows
  759. X60 Corridor continues straight, widens
  760. X68 Corridor turns left
  761. X76 Corridor turns right
  762. X81 Corridor enters from left
  763. X86 Corridor enters from right
  764. X92 Corridor creates 'T' intersection
  765. X97 Corridor creates '+' intersection
  766. X100 Corridor Dead Ends
  767. END_OF_Dungeon/corr_sect
  768. if test 313 -ne `wc -c <Dungeon/corr_sect`; then
  769.     echo shar: \"Dungeon/corr_sect\" unpacked with wrong size!
  770. fi
  771. # end of overwriting check
  772. fi
  773. if test -f Dungeon/exits -a "${1}" != "-c" ; then 
  774.   echo shar: Will not over-write existing file \"Dungeon/exits\"
  775. else
  776. echo shar: Extracting \"Dungeon/exits\" \(145 characters\)
  777. sed "s/^X//" >Dungeon/exits <<'END_OF_Dungeon/exits'
  778. X40 No other exits
  779. X51 A door on opposite wall
  780. X62 A door on left wall
  781. X73 A door on right wall
  782. X82 A door on two other walls
  783. X100 A door on each wall
  784. END_OF_Dungeon/exits
  785. if test 145 -ne `wc -c <Dungeon/exits`; then
  786.     echo shar: \"Dungeon/exits\" unpacked with wrong size!
  787. fi
  788. # end of overwriting check
  789. fi
  790. if test -f Dungeon/jewel -a "${1}" != "-c" ; then 
  791.   echo shar: Will not over-write existing file \"Dungeon/jewel\"
  792. else
  793. echo shar: Extracting \"Dungeon/jewel\" \(144 characters\)
  794. sed "s/^X//" >Dungeon/jewel <<'END_OF_Dungeon/jewel'
  795. X20 stat *emeralds 3 20
  796. X35 stat *rubies 2 40
  797. X50 A diamond necklace
  798. X65 A pair of jeweled bracers
  799. X80 stat *diamonds 1 12
  800. X100 A few worthless rocks
  801. END_OF_Dungeon/jewel
  802. if test 144 -ne `wc -c <Dungeon/jewel`; then
  803.     echo shar: \"Dungeon/jewel\" unpacked with wrong size!
  804. fi
  805. # end of overwriting check
  806. fi
  807. if test -f Dungeon/monster -a "${1}" != "-c" ; then 
  808.   echo shar: Will not over-write existing file \"Dungeon/monster\"
  809. else
  810. echo shar: Extracting \"Dungeon/monster\" \(201 characters\)
  811. sed "s/^X//" >Dungeon/monster <<'END_OF_Dungeon/monster'
  812. X15 Giant Spider
  813. X20 Hill Giant
  814. X25 Orc
  815. X28 Earth Elemental
  816. X37 subtable undead 1 100
  817. X43 Werewolf
  818. X48 Gremlin
  819. X50 Centaur
  820. X58 Dragon
  821. X63 Goblin
  822. X68 Salamander
  823. X75 Griffon
  824. X83 Shadow
  825. X92 Floating Eye
  826. X100 Giant Bear
  827. END_OF_Dungeon/monster
  828. if test 201 -ne `wc -c <Dungeon/monster`; then
  829.     echo shar: \"Dungeon/monster\" unpacked with wrong size!
  830. fi
  831. # end of overwriting check
  832. fi
  833. if test -f Dungeon/room_cont -a "${1}" != "-c" ; then 
  834.   echo shar: Will not over-write existing file \"Dungeon/room_cont\"
  835. else
  836. echo shar: Extracting \"Dungeon/room_cont\" \(61 characters\)
  837. sed "s/^X//" >Dungeon/room_cont <<'END_OF_Dungeon/room_cont'
  838. X30 nothing
  839. X65 table Creature 0 0
  840. X100 subtable treasure 1 100
  841. END_OF_Dungeon/room_cont
  842. if test 61 -ne `wc -c <Dungeon/room_cont`; then
  843.     echo shar: \"Dungeon/room_cont\" unpacked with wrong size!
  844. fi
  845. # end of overwriting check
  846. fi
  847. if test -f Dungeon/trap -a "${1}" != "-c" ; then 
  848.   echo shar: Will not over-write existing file \"Dungeon/trap\"
  849. else
  850. echo shar: Extracting \"Dungeon/trap\" \(124 characters\)
  851. sed "s/^X//" >Dungeon/trap <<'END_OF_Dungeon/trap'
  852. X24 needle trapped
  853. X45 poisonous gas trapped
  854. X53 sleep gas trapped
  855. X60 crossbow trapped
  856. X75 electrically trapped
  857. X100 not trapped
  858. END_OF_Dungeon/trap
  859. if test 124 -ne `wc -c <Dungeon/trap`; then
  860.     echo shar: \"Dungeon/trap\" unpacked with wrong size!
  861. fi
  862. # end of overwriting check
  863. fi
  864. if test -f Dungeon/treasure -a "${1}" != "-c" ; then 
  865.   echo shar: Will not over-write existing file \"Dungeon/treasure\"
  866. else
  867. echo shar: Extracting \"Dungeon/treasure\" \(87 characters\)
  868. sed "s/^X//" >Dungeon/treasure <<'END_OF_Dungeon/treasure'
  869. X35 stat *gold_pieces 3 30
  870. X65 subtable jewel 1 100
  871. X90 subtable weapon 1 100
  872. X100 Nothing
  873. END_OF_Dungeon/treasure
  874. if test 87 -ne `wc -c <Dungeon/treasure`; then
  875.     echo shar: \"Dungeon/treasure\" unpacked with wrong size!
  876. fi
  877. # end of overwriting check
  878. fi
  879. if test -f Dungeon/undead -a "${1}" != "-c" ; then 
  880.   echo shar: Will not over-write existing file \"Dungeon/undead\"
  881. else
  882. echo shar: Extracting \"Dungeon/undead\" \(95 characters\)
  883. sed "s/^X//" >Dungeon/undead <<'END_OF_Dungeon/undead'
  884. X23 Skeleton
  885. X37 Ghoul
  886. X50 Mind Flayer
  887. X60 Generic Undead
  888. X70 Ghost
  889. X80 Wraith
  890. X90 Zombie
  891. X100 Vampire
  892. END_OF_Dungeon/undead
  893. if test 95 -ne `wc -c <Dungeon/undead`; then
  894.     echo shar: \"Dungeon/undead\" unpacked with wrong size!
  895. fi
  896. # end of overwriting check
  897. fi
  898. if test -f Dungeon/weapon -a "${1}" != "-c" ; then 
  899.   echo shar: Will not over-write existing file \"Dungeon/weapon\"
  900. else
  901. echo shar: Extracting \"Dungeon/weapon\" \(110 characters\)
  902. sed "s/^X//" >Dungeon/weapon <<'END_OF_Dungeon/weapon'
  903. X15 Broad Sword
  904. X25 Long Sword
  905. X37 Two-handed Sword
  906. X50 Battle Axe
  907. X70 Quarter Staff
  908. X85 Spear
  909. X100 Claws/Bare Hands
  910. END_OF_Dungeon/weapon
  911. if test 110 -ne `wc -c <Dungeon/weapon`; then
  912.     echo shar: \"Dungeon/weapon\" unpacked with wrong size!
  913. fi
  914. # end of overwriting check
  915. fi
  916. echo shar: End of shell archive.
  917. exit 0
  918.